<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head></h:head>

<h:body>
	<ui:include src="WelcomePage.xhtml" />

	<h:form id="formClient">
		<p:growl showDetail="true" />
		<p:panel id="painelCadastroPF" header="Cadastro de Pessoa Física">
			<p:messages id="globalMessages" />
			<h:panelGrid columns="3">
				<h:outputLabel id="labelId" value="ID:" for="textBoxId" />
				<p:inputText id="textBoxId" value="#{clientBean.clientPF.id}"
					readonly="true" size="2" disabled="true">
				</p:inputText>
				<br />

				<h:outputLabel id="labelName" value="Nome:" for="textBoxName" />
				<p:inputText id="textBoxName" value="#{clientBean.clientPF.name}"
					size="50" required="true"
					requiredMessage="O campo nome é obrigatório" maxlength="60">
				</p:inputText>
				<br />

				<h:outputLabel id="labelAddress" value="Endereço:"
					for="textBoxAddress"></h:outputLabel>
				<p:inputText id="textBoxAddress"
					value="#{clientBean.clientPF.address}" size="60" maxlength="80">
				</p:inputText>
				<br />

				<h:outputLabel id="labelPhone" value="Telefone:" for="textBoxPhone"></h:outputLabel>
				<p:inputMask id="textBoxPhone" value="#{clientBean.clientPF.phone}"
					size="10" maxlength="20" mask="(99)9999-9999">
				</p:inputMask>
				<br />

				<h:outputLabel id="labelEmail" value="Email:" for="textBoxEmail"></h:outputLabel>
				<p:inputText id="textBoxEmail" value="#{clientBean.clientPF.email}"
					size="20" maxlength="30">
				</p:inputText>
				<br />

				<h:outputLabel id="labelSex" value="Sexo:" for="textBoxSex"></h:outputLabel>
				<p:inputText id="textBoxSex" value="#{clientBean.clientPF.sex}"
					size="2" maxlength="1">
				</p:inputText>
				<br />

				<h:outputLabel id="labelCpf" value="CPF:" for="textBoxCpf"></h:outputLabel>
				<p:inputMask id="textBoxCpf" value="#{clientBean.clientPF.cpf}"
					size="15" required="true"
					requiredMessage="O campo CPF é obrigatório" maxlength="19"
					mask="999.999.999-99">
				</p:inputMask>
				<br />

				<h:outputLabel id="labelRg" value="RG:" for="textBoxRg"></h:outputLabel>
				<p:inputText id="textBoxRg" value="#{clientBean.clientPF.rg}"
					size="15" maxlength="12">
				</p:inputText>
				<br />

				<h:outputLabel id="labelBirthDate" value="Data Nascimento:"
					for="textBoxBirthDate"></h:outputLabel>
				<p:inputMask id="textBoxBirthDate"
					value="#{clientBean.clientPF.birthDate}" size="15" maxlength="10"
					mask="99/99/9999">
				</p:inputMask>
				<br />

				<h:outputLabel id="labelCnh" value="CNH:" for="textBoxCnh"></h:outputLabel>
				<p:inputText id="textBoxCnh" value="#{clientBean.clientPF.cnh}"
					size="15" maxlength="15">
				</p:inputText>
				<br />

				<h:outputLabel id="labelCategory" value="Categoria:"
					for="textBoxCategory"></h:outputLabel>
				<p:inputText id="textBoxCategory"
					value="#{clientBean.clientPF.category}" size="2" maxlength="1">
				</p:inputText>
				<br />

				<h:outputLabel id="labelUfIssue" value="UF emissora:"
					for="textBoxUfIssue"></h:outputLabel>
				<p:inputText id="textBoxUfIssue"
					value="#{clientBean.clientPF.ufIssue}" size="2" maxlength="2">
				</p:inputText>
				<br />

				<h:outputLabel id="labelValidityCnh" value="Validade CNH:"
					for="textBoxValidityCnh"></h:outputLabel>
				<p:inputMask id="textBoxValidityCnh"
					value="#{clientBean.clientPF.validityCnh}" size="15" maxlength="10"
					mask="99/99/9999">
				</p:inputMask>
				<br />
			</h:panelGrid>
			<h:panelGrid columns="2">

				<p:commandButton id="buttonSave" value="Salvar"
					update="@form,globalMessages,formClient,painelCadastroPF"
					action="#{clientBean.saveClientPF}" />
				<p:commandButton id="buttonCancel" value="Cancelar"
					update="formClient" action="#{clientBean.cancelOperation}" />
				<p:blockUI block="painelCadastroPF" trigger="buttonSave">
					<p:graphicImage value="images/loading.gif" />
				</p:blockUI>
			</h:panelGrid>

		</p:panel>
	</h:form>

</h:body>
</html>